/*
 * Class Liver.java
 * 9.06.2012
 * 
 * Class represents liver organ.
 */

package human;

/**
 * Class implements a model of human liver. It has a number of characteristics
 * (such as glucose and cholesterol level) which changes according human
 * activities. Liver could be cause of death because it's vital organ.
 * 
 * @author Vasyl Khyzhniak
 * @version 1.2
 */
public class Liver extends Organ {
	private int detoxification; // opportunity to neutralize toxic elements
	private int cholesterol; 	// level of cholesterol
	private int glucose; 		// level of glucose

	/**
	 * Liver Class Constructor Sets all live characteristics to newborn level
	 * which is equal to zero. Also defines liver as necessary for life organ
	 * (isNecessaryForLife = true)
	 */
	public Liver() {
		health = 0;
		cholesterol = 0;
		detoxification = 0;
		glucose = 0;
		isNecessaryForLife = true;
                name="Liver";
                parametrs.addParameter(new Parameter("detoxification", 100));
                parametrs.addParameter(new Parameter("health", 100));
                parametrs.addParameter(new Parameter("glucose", 100));
                parametrs.addParameter(new Parameter("cholesterol", 100));

	}

	/**
	 * Changes cholesterol level on value
	 * 
	 * @param value
	 *            Defines the change of cholesterol level
	 */
	public void changeCholesterol(int value) {
		cholesterol = checkLimits(cholesterol, value);
		;
	}

	/**
	 * Changes detoxifacation level on value
	 * 
	 * @param value
	 *            Defines the change of detoxification level
	 */
	public void changeDetoxification(int value) {
		detoxification = checkLimits(detoxification, value);
	}

	/**
	 * Changes glucose level on value
	 * 
	 * @param value
	 *            Defines the change of glucose level
	 */
	public void changeGlucose(int value) {
		glucose = checkLimits(glucose, value);
	}

	public int getCholesterol() {
		return cholesterol;
	}

	public int getDetoxification() {
		return detoxification;
	}

	public int getGlucose() {
		return glucose;
	}
}
